﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Kooboo.Commerce;

using Kooboo.IoC;

namespace Kooboo.Web.Areas.Commerce.Binders
{
    public class ShopSettingBinder:EntityBinder
    {
        protected override object CreateModel(System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext, Type modelType)
        {
            var settings = ObjectContainer.CreateInstance<IShopSetting>();

            settings.ImageSettings = ObjectContainer.CreateInstance<IImageSettings>();
            settings.ImageSettings.CustomSizes = new List<IImageSize>();

            return settings;
        }
    }
}